﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PEAnalyzer.ModeView.PEInfoPage
{
    internal class SectionHeaderViewItem : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private string m_strName;
        private UInt32 m_uVirtualAddress;
        private UInt32 m_uVirtualSize;
        private UInt32 m_uPointerToRawData;
        private UInt32 m_uSizeOfRawData;
        private UInt32 m_uPointerToRelocations;
        private UInt32 m_uPointerToLinenumbers;
        private UInt16 m_uNumberOfRelocations;
        private UInt16 m_uNumberOfLinenumbers;
        private UInt32 m_uCharacteristics;

        public string Name
        {
            get => m_strName;

            set
            {
                m_strName = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Name"));
            }
        }

        public UInt32 VirtualAddress
        {
            get => m_uVirtualAddress;

            set
            {
                m_uVirtualAddress = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("VirtualAddress"));
            }
        }

        public UInt32 VirtualSize
        {
            get => m_uVirtualSize;

            set
            {
                m_uVirtualSize = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("VirtualSize"));
            }
        }

        public UInt32 PointerToRawData
        {
            get => m_uPointerToRawData;

            set
            {
                m_uPointerToRawData = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("PointerToRawData"));
            }
        }

        public UInt32 SizeOfRawData
        {
            get => m_uSizeOfRawData;

            set
            {
                m_uSizeOfRawData = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SizeOfRawData"));
            }
        }

        public UInt32 PointerToRelocations
        {
            get => m_uPointerToRelocations;

            set
            {
                m_uPointerToRelocations = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("PointerToRelocations"));
            }
        }

        public UInt32 PointerToLinenumbers
        {
            get => m_uPointerToLinenumbers;

            set
            {
                m_uPointerToLinenumbers = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("PointerToLinenumbers"));
            }
        }

        public UInt16 NumberOfRelocations
        {
            get => m_uNumberOfRelocations;

            set
            {
                m_uNumberOfRelocations = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("NumberOfRelocations"));
            }
        }

        public UInt16 NumberOfLinenumbers
        {
            get => m_uNumberOfLinenumbers;

            set
            {
                m_uNumberOfLinenumbers = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("NumberOfLinenumbers"));
            }
        }

        public UInt32 Characteristics
        {
            get => m_uCharacteristics;

            set
            {
                m_uCharacteristics = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Characteristics"));
            }
        }
    }
}
